<div class="animated fadeIn">

  <div class="row container-fluid">

    <div class="form-group col-md-5" >
      <select name="select" class="form-control" [(ngModel)]="saveDate.key">
        <option value="1">企业名称</option>
      </select>
    </div>

    <div class="form-group col-md-3">
      <input type="text" class="form-control input-down btn-radius" name="number" [(ngModel)]="saveDate.keywords">
    </div>




    <!--查询-->
    <div class="form-group col-md-1" style="padding-left:5px">
      <button type="button" class="btn btn-primary btn-radius" (click)="getPersonDate()">查询</button>
    </div>

    <div class="col-md-1"></div>

    <!--新增按钮-->
    <div class="form-group col-md-1" style="padding-left:5px">
      <button type="button" class="btn btn-success btn-radius" routerLink="add">新增品牌</button>
    </div>


  </div>


  <div class="table-responsive" style="overflow: auto">
    <table class="table table-center table-bordered table-hover" style="min-width: 0px">
      <thead class="table-inverse">
      <tr class="text-nowrap">
        <td>序号</td>
        <td>LOGO图片</td>
        <td>企业名称</td>
        <td>类型</td>
        <td>网络人气榜</td>
        <td>品牌价值榜</td>
        <td>爱心公益榜</td>
        <td>商业赞助榜</td>
        <td>企业实力榜</td>
        <td>与时俱进榜</td>
        <td>幸福指数榜</td>
        <td>上架状态</td>
        <td>新增日期</td>
        <td>操作</td>
      </tr>
      </thead>
      <tbody class="tab-content">
      <tr class="text-nowrap" *ngFor="let item of dataArr let i = index">
        <td>{{i+1}}</td>
        <td><img style="width: 150px;" src="{{imgUrl+item.logo}}"></td>
        <td>{{item.name}}</td>
        <td>
          <span *ngIf="item.type == 1">百年品牌</span>
          <span *ngIf="item.type == 2">准百年品牌</span>
        </td>
        <td>{{item.Popularity}}人气</td>
        <td>{{item.value}}万元</td>
        <td>{{item.Charity}}万元</td>
        <td>{{item.Support}}元</td>
        <td>{{item.GProfit}}万元</td>
        <td>{{item.Innovation}}创新力</td>
        <td>{{item.Happiness}}%</td>
        <td>
          <span *ngIf="item.shelves == 2">未上架</span>
          <span *ngIf="item.shelves == 1">已上架</span>
        </td>
        <td>{{item.addTime*1000 | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
        <td>
          <a href="javascript:;" (click)="smallModal.show();clickShelves(item.id, item.shelves, 1 , item.type)">
            <span *ngIf="item.shelves == 2">上架</span>
            <span *ngIf="item.shelves == 1">下架</span>
          </a>
          <a style="color: rgb(82,188,118);" href="javascript:;" *ngIf="item.shelves == 2" [routerLink]="['edit',item.id]">编辑</a>
          <span class="removeBtn" *ngIf="item.shelves == 2" href="javascript:;" (click)="smallModal.show();deleteitem(item.id, 2)" >删除</span>
        </td>
      </tr>
      </tbody>
    </table>
    <p *ngIf="!dataArr.length"  class="noneData">暂无数据</p>

    <!--分页组件-->
    <div style="float: right">
      <pagination [boundaryLinks]="true" [totalItems]="totalItems" [(ngModel)]="currentPage" itemsPerPage="10" [maxSize]="maxSize" previousText="上一页" nextText="下一页" firstText="首页" lastText="末页" (pageChanged)="pageChanged($event)"></pagination>
    </div>
  </div>
</div>

<div bsModal #smallModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-primary modal-sm" [ngClass]="{'modal-danger': !shelvesorDeletes, 'modal-primary':shelvesorDeletes}" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">提示</h5>
        <button type="button" class="close" (click)="smallModal.hide()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body" style="text-align: center" >
        <p style="margin: 0px" >{{modalText}}</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" (click)="smallModal.hide()">取消</button>
        <button  (click)="smallModal.hide()" type="button" class="btn btn-primary" [ngClass]="{'btn-danger': !shelvesorDeletes, 'btn-primary':shelvesorDeletes}"  (click)="smallModal.hide(); definiteRequest();" >确定</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div>


<div *ngIf="dangerModal" [config]="{ show: true }" (onHidden)="hideModal()" bsModal #autoShownModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-sm" [ngClass]="{'modal-danger': !issuccess, 'modal-success':issuccess}">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title pull-left">提示</h4>
        <button type="button" class="close pull-right" aria-label="Close" (click)="hideModal()">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body" style="text-align: center;">
        <p style="margin: 0px">{{successText}}</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn " [ngClass]="{'btn-success':issuccess,'btn-danger':!issuccess}" (click)="hideModal();">确定</button>
      </div>
    </div>
  </div>
</div>
